<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>优惠劵设置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
    <link rel="stylesheet" href="../js/lay-module/step-lay/step.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <div class="layui-fluid">
            <div class="layui-card">
                <div class="layui-card-body" style="padding-top: 40px;">
                    <div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
                        <div carousel-item>
                            <div>
                                <form class="layui-form" style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">优惠劵金额:</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="请填写金额" class="layui-input" lay-verify="number" required />

                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">需用积分:</label>
                                        <div class="layui-input-block">
                                            <input type="number" placeholder="请填写积分数" value="" class="layui-input" lay-verify="number" required>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">兑换限制:</label>
                                        <div class="layui-input-block">
                                            <select lay-verify="required">
                                                <option value="1" selected>无限制</option>
                                                <option value="2">每日一兑</option>
                                                <option value="3">每周一兑</option>
                                                <option value="3">每月一兑</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">有效期:</label>
                                        <div class="layui-input-block">
                                            <input type="number" placeholder="请填写天数" value="" class="layui-input" lay-verify="number" required>
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit lay-filter="formStep">
                                                &emsp;下一步&emsp;
                                            </button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div>
                                <form class="layui-form-item" style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">发布日期:</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="date" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">发布对象:</label>
                                        <div class="layui-input-block">
                                            <select lay-verify="required">
                                                <option value="1" selected>无限制</option>
                                                <option value="2">七日内用户</option>
                                                <option value="3">一年内用户</option>
                                                <option value="3">一年以上用户</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
                                        <div class="layui-input-block">
                                            <button type="button" class="layui-btn layui-btn-primary pre">上一步</button>
                                            <button class="layui-btn" lay-submit lay-filter="formStep2">
                                                &emsp;确认&emsp;
                                            </button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div>
                                <div style="text-align: center;margin-top: 90px;">
                                    <i class="layui-icon layui-circle"
                                       style="color: white;font-size:30px;font-weight:bold;background: #52C41A;padding: 20px;line-height: 80px;">&#xe605;</i>
                                    <div style="font-size: 24px;color: #333;font-weight: 500;margin-top: 30px;">
                                        添加成功
                                    </div>
                                </div>
                                <div style="text-align: center;margin-top: 50px;">
                                    <button class="layui-btn next">再次添加</button>
                                    <button class="layui-btn layui-btn-primary" onclick="retu()">查看优惠劵</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
    function retu(){
        location.href="couponMessage.html";
    }
</script>
<script>
    layui.use([ 'form', 'step', 'layedit', 'laydate'], function () {
        var $ = layui.$,
            form = layui.form,
            step = layui.step,
            layer = layui.layer,
            layedit = layui.layedit,
            laydate = layui.laydate;
        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        step.render({
            elem: '#stepForm',
            filter: 'stepForm',
            width: '100%', //设置容器宽度
            stepWidth: '750px',
            height: '500px',
            stepItems: [{
                title: '填写优惠劵信息'
            }, {
                title: '填写优惠劵设置'
            }, {
                title: '完成'
            }]
        });

        form.on('submit(formStep)', function (data) {
            step.next('#stepForm');
            return false;
        });

        form.on('submit(formStep2)', function (data) {
            step.next('#stepForm');
            return false;
        });

        $('.pre').click(function () {
            step.pre('#stepForm');
        });

        $('.next').click(function () {
            step.next('#stepForm');
        });
    })
</script>
</body>
</html>